package scala

import main.scala.AST._

class TestSimplifyProduct extends Test {

  test("multiply integers") {
    var ref = NumI(12)
    assertSimplifyString("4*3", ref)
  }
  
  test("division and neutral") {
    var ref = NumI(1)
    assertSimplifyString("8/8", ref)
  }
  
  test("division by zero") {
    pending
//    assertSimplifyString("8/0")
  }
  
  test("zero divided by 1") {
    var ref = NumI(0)
    assertSimplifyString("0/1", ref)
  }
  
  test("zero divided by 10") {
    var ref = NumI(0)
    assertSimplifyString("0/10", ref)
  }
  
  
  /* Test with variables. */
  
  test("variable") {
    assertSimplifyString("a*0", NumI(0))
    assertSimplifyString("a*1", Var("a"))
    assertSimplifyString("a*2", Mul(List(Var("a"),NumI(2))))
  }
}
